package org.lex.dbq.view.browser;

import org.eclipse.swt.widgets.Composite;
import org.lex.dbq.DBQApplication;
import org.lex.dbq.model.bo.Session;
import org.lex.dbq.model.service.ServiceFactory;

public class SessionPane extends AbstractBrowser<Session> {
	public SessionPane(Composite parent) {
		super(parent, ServiceFactory.getSessionService());
	}

	@Override
	public void connect() {
		String name = null;
		if (false == this.getSelection().isEmpty()) {
			name = this.getSelectedObjects().get(0).getName();
		}
		log.debug("open session: " + name);
		DBQApplication app = DBQApplication.getApplication();
		app.getOperator().showConnectSessionDialog(name);
	}
}
